package hwOne2;

import edu.princeton.cs.algs4.StdOut;

/**
 * 作业 1.2.6
 */
public class CheckLoop {
    public static boolean checkLoop(String s1, String s2) {
        if (s1.length() != s2.length()) {
            return false;
        }

        return (s1 + s1).indexOf(s2) != -1;
    }
    public static void main(String[] args) {
        String s1 = "ACTGACG";
        String s2 = "TGACGAC";
        Boolean result = checkLoop(s1, s2);
        StdOut.println("结果：" + result);
    }
}
